﻿<?php
//	echo sha1('HOPElight007+wx934cb7f852f6c585');
//	require_once('wxbrower.php');
	require_once("../includes/public.inc.php");
	$s = isset($_GET['s'])?$_GET['s']:'';
	//echo $_GET['openid'];exit;
	$openid = isset($_GET['openid'])?$_GET['openid']:'';
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,user-scalable=no,maximum-scale=1,initial-scale=1">
<title>导购注册</title>
<link rel="stylesheet" type="text/css" href="../user/css/register.css" media="all">
</head>
<body style="background-color:#e50065;">
<div class="pz-css"  style="background:url(../user/images/yalina.png);">
	<ul class="top-tool" style="margin-top:-20px;">
		<li class="title">导购注册</li>
		<li class="back"><a href="javascript:history.go(-1)"></a>
<!--		</li><li class="home"><a href="index.php"></a></li>-->
	</ul>
	<form action="register_check.php?act=dg&s=<?=$s?>&openid=<?=$openid?>" id="submit_form" method="post">
 		<div class="pz-panel" >
			<h3>导购注册：</h3>
			<p>请认真注册以下内容，方便您积分、红包领取等。</p>
		</div>
		<div class="pz-panel" style="background-color: rgb(255, 255, 255);">
			<table class="list" border="0" cellspacing="0" width="100%">
				<tbody>
					<tr>
						<td style="color: red;" width="90">手机号码：</td>
						<td align="left"><span class="span12"><input maxlength="20" placeholder="号码将为您的登录帐号" id="userID" name="user" type="tel"></span></td>
					</tr>
					<tr>
						<td>真实姓名：</td>
						<td align="left"><span class="span12"><input value="" maxlength="20" placeholder="必填" id="userName" name="userName" type="text"></span></td>
					</tr>
					<tr>
						<td>店铺固话：</td>
						<td align="left"><span style="width:80px;" class="span6"><input maxlength="20" value="" placeholder="区号" id="area" name="area" type="text"></span><span style="width:160px;" class="span6"><input maxlength="20" value="" placeholder="必填 电话号码" id="tel" name="tel" type="tel"></span></td>
					</tr>
					<tr>
						<td>输入密码：</td>
						<td align="left"><span class="span12"><input maxlength="20" value="" placeholder="必填" id="userPWD" name="password" type="password"></span></td>
					</tr>
					<tr>
						<td>确定密码：</td>
						<td align="left"><span class="span12"><input maxlength="20" value="" placeholder="必填" id="ReuserPWD" name="password2" type="password"></span></td>
					</tr>
					<tr>
						<td>门店名称：</td>
						<td align="left"><span class="span12"><input value="" placeholder="必填" id="shopname" name="shopname" type="text"></span></td>
					</tr>
					<tr>
						<td>省&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份：</td>
						<td align="left">
							<span class="span12">
								<select id="selProvince" name="province" onchange="provinceChange();"></select>
							</span>
						</td>
					</tr>
					<tr>
						<td>市&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;区：</td>
						<td align="left">
							<span class="span12">
								<select id="selCity" name="city"></select> 
							</span>
						</td>
					</tr>
					
					<tr>
						<td>微&nbsp;&nbsp;信&nbsp;&nbsp;号：</td>
						<td align="left"><span class="span12"><input maxlength="20" value="" placeholder="必填，请正确填写" id="wx" name="wx" type="text"></span></td>
					</tr>
					<tr>
						<td>联系我们：</td>
						<td align="left"><span class="span12"><a href="tel:4008181119">400-818-1119</a></span></td>
					</tr>
				</tbody>
			</table>
		</div>
	    <input value="0"  name="credit" type="hidden" />  
	    <input value="0"  name="s" type="hidden" />
	    <input value="1"  name="yz" type="hidden" />
		<div class="group">
			<div class="span12">
				<button class="red" style="background:#13d6f9;border:0px;" type="submit" name="submit" id="submit">同意会员服务协议并注册</button>
			</div>
		</div>
	</form>
	<form action="login.php" id="login_form" method="get">
		<input value="<?=$s?>"  name="s" type="hidden">
<!--		<input value="hy"  name="type" type="hidden">-->
		<input value="<?=$openid?>"  name="openid" type="hidden">
		<div class="group">
		<div class="span12">
			<button class="yellow" type="submit" style="background:#91d400;border:1px solid #91d400;">已注册用户请登录</button>
		</div>
	</form>
	<div class="pz-panel">
		<h3>温馨提示：</h3>
		<p>尊敬的用户，您好！欢迎注册导购，请仔细阅读<a style="color: rgb(51, 153, 255);" href="xieyi.php?id=1">《 会员注册服务使用协议 》</a></p>
	</div>
	
   <!-- <div class="pz-panel">
			<h3>成为导购员请点击以下注册：</h3>
			<p>尊敬的导购员！欢迎注册成为本公司的导购员，<a style="color: rgb(51, 153, 255);" href="register_daogou.php?s=0">《 成为导购 》</a></p>
		</div>
	</div>-->
<script src="../user/js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="../user/js/sel.js"   charset="gb2312"></script>
<script type="text/javascript">
$(function(){
	$('#submit').click(function(){
		var tel = $('#area').val()+'-'+$('#tel').val();
		if (!$('#userID').val())
		{
			alert("请输入用户名！");return false;
		}
		else
		{
			if (!vailPhone($('#userID').val()))
			{ 
				alert('请输入正确的电话或者手机号码');return false;
			}
		}
		if (!$('#userName').val())
		{
			alert("请输入真实姓名");return false;
		}
		if (!$('#tel').val())
		{
			alert("请输入电话号码");return false;
		}
		else
		{
			if (!$('#area').val()){
				alert("请输入区号");return false;
			}
			else
			{
				if (!istell(tel))
				{ 
					alert('请输入正确的电话号码');return false;
				}
			}
		}
		if (!$('#userPWD').val())
		{
			alert("请输入密码");return false;
		}
		if (!$('#ReuserPWD').val())
		{
			alert("请确认密码");return false;
		}
		if ($('#userPWD').val()!=$('#ReuserPWD').val())
		{
			alert("两次输入密码不一致");return false;
		}
		
		if (!$('#wx').val())
		{
			alert("请认真填写正确的微信号！该微信号将作为发红包的依据!");return false;
		}
	});
});
function istell(str)
{
	var result=str.match(/\d{3}-\d{8}|\d{4}-\d{7}/);
	if(result==null) return false;
	return true;
}
function vailPhone(str)
{
    var phone = str;//jQuery("#phone").val();
    var flag = false;
    var message = "";
    var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;       
    if(phone == ''){
      message = "手机号码不能为空！";
    }else if(phone.length !=11){
      message = "请输入有效的手机号码！";
    }else if(!myreg.test(phone)){
      message = "请输入有效的手机号码！";
    }else{
        flag = true;
    }
    if(!flag){
   //提示错误效果
      //jQuery("#phoneDiv").removeClass().addClass("ui-form-item has-error");
      //jQuery("#phoneP").html("");
      //jQuery("#phoneP").html("<i class=\"icon-error ui-margin-right10\"> <\/i>"+message);
      //jQuery("#phone").focus();
    }else{
         //提示正确效果
      //jQuery("#phoneDiv").removeClass().addClass("ui-form-item has-success");
      //jQuery("#phoneP").html("");
      //jQuery("#phoneP").html("<i class=\"icon-success ui-margin-right10\"> <\/i>该手机号码可用");
    }
    return flag;
}
</script>
</body>
</html>